﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CMSWindowsFormsApp2
{
    public partial class WorkerForm : Form
    {
        public WorkerForm()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'workerDataSet1.tblWorker' table. You can move, or remove it, as needed.
            this.tblWorkerTableAdapter1.Fill(this.workerDataSet1.tblWorker);
            // TODO: This line of code loads data into the 'cMSDATABASEDataSet.tblWorker' table. You can move, or remove it, as needed.
            this.tblWorkerTableAdapter.Fill(this.cMSDATABASEDataSet.tblWorker);

        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            this.workerDataSet1.Clear();
            this.sqlDataAdapter1.Fill(this.workerDataSet1.tblWorker);
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            this.sqlDataAdapter1.Update(this.workerDataSet1.tblWorker);

              MessageBox.Show("Save Success");
        }

        private void btnCancle_Click(object sender, EventArgs e)
        {
            this.workerDataSet1.Clear();
            this.sqlDataAdapter1.Fill(this.workerDataSet1.tblWorker);

        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
